package com.wolfeyes.common.utils.network.web;

import java.util.UUID;

/**
 * @title 请求ID操作处理的工具类-RequestId
 * @author yanyljava
 * @date 2015-09-22 10:59
 */
public class RequestIdUtils {

	private static final ThreadLocal<UUID> requestIdHolder = new ThreadLocal<UUID>();

    public static void generateRequestId() {
        requestIdHolder.set(UUID.randomUUID());
    }

    public static void generateRequestId(UUID uuid) {
        requestIdHolder.set(uuid);
    }

    public static UUID getRequestId() {
        return requestIdHolder.get();
    }

    public static void removeRequestId() {
        requestIdHolder.remove();
    }
}
